package com.thread.n2;

import lombok.extern.slf4j.Slf4j;

import java.io.FileReader;
import java.io.IOException;
/**
 * 同步等待
 */
@Slf4j(topic = "c.Sync")
public class Sync {
    private static String path="C:\\Users\\zwy\\Desktop\\1626198452655.srt";
    public static void main(String[] args) {
        FileReader fr = null;
        try {
            fr = new FileReader(path);

            int ch = fr.read();
            while (ch != -1) {
                System.out.print((char) ch);
                ch = fr.read();
            }
            System.out.println();
        } catch (IOException e) {
            System.out.println("异常：" + e.toString());
        } finally {
            try {
                if (fr != null)
                    fr.close();
            } catch (IOException e) {
                System.out.println("异常：" + e.toString());
            }
        }

        System.out.println("other thing to do ");

    }
}
